<@main_macros.mobileShopHeader title="水果团"/>
  <body>
    <!-- Make sure all your bars are the first things in your <body> -->
    <header class="bar bar-nav">
		<a class="icon icon-left-nav pull-left" href="${ctx?if_exists}/mobile/wxshop/listGoods"
			data-transition="slide-out"></a> 
		<h1 class="title">商品编辑</h1>
		<#if (goods.id)?exists>
		<form  method="post" id='deleteForm' action="${ctx?if_exists}/mobile/wxshop/deleteGoods" >
			<input type="hidden" name="goods.id" value="${(goods.id)?if_exists}">
			<a class="icon icon-trash pull-right" onclick="javascript:if(confirm('确定删除？')){document.getElementById('deleteForm').submit()}"></a>
		</form>
		</#if>
    </header>

    <!-- Wrap all non-bar HTML in the .content div (this is actually what scrolls) -->
    
    <div class="content">
	<form  method="post" action="<#if (goods.id)?exists>${ctx?if_exists}/mobile/wxshop/updateGoods"<#else>${ctx?if_exists}/mobile/wxshop/saveGoods"</#if>  enctype="multipart/form-data">
		<div class="uploadfile" style="padding:10px 10px;width:100%">
			<input class="fileUpload" onchange="upload(this)" name="image0" type="file"  capture="camera" />
			<span class="a-upload" <#if imageList?exists&&imageList?size gt 0>onclick="delUpload(this)" <#else> onclick="clickPre(this)"</#if>>
				<#if imageList?exists&&imageList?size gt 0><img src='${ctx?if_exists}${imageList[0].url}' width="60px" height="60px"><#else><br>+</#if>
			</span>
			
			<input class="fileUpload" onchange="upload(this)"  name="image1" type="file"  capture="camera" />
			<span class="a-upload" <#if imageList?exists&&imageList?size gt 1>onclick="delUpload(this)" <#else> onclick="clickPre(this)"</#if>>
				<#if imageList?exists&&imageList?size gt 1><img src='${ctx?if_exists}${imageList[0].url}' width="60px" height="60px"><#else><br>+</#if>
			</span>

			<input class="fileUpload" onchange="upload(this)" name="image2" type="file"  capture="camera" />
			<span class="a-upload" <#if imageList?exists&&imageList?size gt 2>onclick="delUpload(this)" <#else> onclick="clickPre(this)"</#if>>
				<#if imageList?exists&&imageList?size gt 2><img src='${ctx?if_exists}${imageList[0].url}' width="60px" height="60px"><#else><br>+</#if>
			</span>

			<input class="fileUpload" onchange="upload(this)" name="image3"  type="file"  capture="camera" />
			<span class="a-upload" <#if imageList?exists&&imageList?size gt 3>onclick="delUpload(this)" <#else> onclick="clickPre(this)"</#if>>
				<#if imageList?exists&&imageList?size gt 3><img src='${ctx?if_exists}${imageList[0].url}' width="60px" height="60px"><#else><br>+</#if>
			</span>

			<input class="fileUpload" onchange="upload(this)" name="image4"  type="file"  capture="camera" />
			<span class="a-upload" <#if imageList?exists&&imageList?size gt 4>onclick="delUpload(this)" <#else> onclick="clickPre(this)"</#if>>
				<#if imageList?exists&&imageList?size gt 4><img src='${ctx?if_exists}${imageList[0].url}' width="60px" height="60px"><#else><br>+</#if>
			</span>
			
		</div>
		
			
      <input type="text" name="goods.name" value="${(goods.name)?if_exists}" placeholder="产品名称">
      <input type="search" placeholder="参考">
      <textarea rows="5" style="padding-bottom:0px;margin-bottom:0px;"></textarea>
	  <div class="goodsModelDiv" style="margin-top:0px;border-top: 1px solid #ddd; ">
		<dl class="goods_model_cls">
   			<dt><span class="icon icon-trash" onclick="deleteGoodsModel(this)" style="padding-top:20px;padding-left:20px;color:Red;display:none"></span></dt>
  			<dd>
				<ul>
					<li><label>型号</lable> <input type="text" name="goodsModel[0].name" style="width:60%;padding:0px;margin:0px;"></li>
					<li><label>价格</lable> <input type="text" name="goodsModel[0].price" style="width:60%;padding:0px;margin:0px;"></li>
				</ul>
			</dd>
		</dl>
		<dl class="addNext">
   			<dt></dt>
  			<dd><a href="javascript:;" onclick="addGoodsModel()" >添加型号</a></dd>
		</dl>
	  </div>
      <input type="submit" class="btn btn-positive btn-block" value="<#if (goods.id)?exists>修改<#else>创建</#if>">
		
     </form>
    </div>
  </body>
</html>